const Repository = require('../repository')

async function main() {
  const repo = new Repository({ dir: '../.state' })
  await repo.init()
  await repo.stat()
  await repo.rollbackLogUntil(800)
  await repo.stat()
  const latestLogs = await repo.getLatestLogs(10)
  console.log('latest logs:', latestLogs)
  const topUsers = await repo.getTopUsers(10)
  console.log('top users:', topUsers)
  const allPixels = await repo.getAllPixels()
  console.log('all pixels length:', allPixels.length)
}

main().then().catch(console.log)